<include file="public@storage"/>
<style>
    #form {
        margin-top: 100px;
        padding-left: 50px;
        padding-right: 50px;
    }
</style>
</head>
<body>

<div>
    <input type="hidden" id="supplier_uuid" value="{$storageInfo.supplier_uuid}">
    <form class="form-horizontal table" id="form" onsubmit="return check()"
          action="{:url('storage/Storage/editStorage')}" method="post">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">仓库信息</h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <input type="hidden" name="uuid" id="uuid" value="{$storageInfo.uuid}">
                    <label id="a" class="col-md-2 control-label" for="name">仓库名：</label>
                    <div class="col-md-2">
                        <input type="text" name="name" id="name" value="{$storageInfo.name}" class="form-control" placeholder="必填项">
                        <span id="nameError" style="color: red"></span>
                    </div>

                    <label class="col-md-2 control-label" for="address">地址：</label>
                    <div class="col-md-2">
                        <input type="text" name="address" id="address" value="{$storageInfo.address}"
                               class="form-control" placeholder="必填项">
                        <span id="addressError"></span>
                    </div>

                    <label class="col-md-2 control-label" for="ip_address">IP地址：</label>
                    <div class="col-md-2">
                        <input type="text" name="ip_address" id="ip_address" value="{$storageInfo.ip_address}"
                               class="form-control" placeholder="必填项">
                        <span id="ipError"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label" for="phone">电话：</label>
                    <div class="col-md-2">
                        <input type="text" name="phone" id="phone" value="{$storageInfo.phone}" class="form-control"
                               placeholder="必填项">
                        <span id="phoneError"></span>
                    </div>

                    <label class="col-md-2 control-label" for="supplier">委外厂商：</label>
                    <div class="col-md-2">
                        <select id="supplier" name="supplier" class="selectpicker  form-control"  data-live-search="true">
                            <option value=""></option>
                            <volist name="supplierInfo" id="vo">
                                <option value="{$vo.uuid}">{$vo.company_name}</option>
                            </volist>
                        </select>
                    </div>
                </div>

                <div class="form-group text-center">
                    <button type="submit" class="mui-btn mui-btn--raised mui-btn--primary" id="submit">保存</button>
                    &nbsp; &nbsp;
                    <button type="button" class="mui-btn mui-btn--raised mui-btn--primary" onclick="history.go(-1)">取消</button>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
<script type="text/javascript" src="__STATIC__/storage/js/storage/check.js"></script>
<script>
    window.onload = function () {
        var supplierUuid = $('#supplier_uuid').val();
        supplierUuid = supplierUuid == null ? '':supplierUuid;
        $("#supplier").selectpicker('val', supplierUuid);
    };


</script>
</html>